﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>智慧公社 文章-多彩阅读</title>

     <link rel="stylesheet" href="__PUBLIC__/css/index.css">
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.css" rel="stylesheet" />
    <link href="__PUBLIC__/css/grumble.min.css" rel="stylesheet" />
    <link href="__PUBLIC__/css/iosOverlay.css"  rel="stylesheet" type="text/css">

    <script src="__PUBLIC__/js/jquery.js"></script>
    <script src="__PUBLIC__/js/headroom.js"></script>
    <script src="__PUBLIC__/js/jquery.snippet.min.js"></script>
    <script src="__PUBLIC__/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/js/jquery.pin.min.js"></script>
    <script src="__PUBLIC__/js/jquery.hotkeys.js"></script>
    <script src="__PUBLIC__/js/bootstrap-wysiwyg.js"></script>
    <script src="__PUBLIC__/js/Bubble.js"></script>
    <script src="__PUBLIC__/js/jquery.grumble.min.js"></script>
     <script src="__PUBLIC__/js/index.js"></script>
    <script src="__PUBLIC__/js/iosOverlay.js"></script>
    <script src="__PUBLIC__/js/spin.min.js"></script>
    <script>
    var url="{:U('Index/Marking')}";
	var urlArticle="{:U('Index/updataArticle')}";
	var urlLookMarking="{:U('Index/lookMarking')}";
	var urlApply="{:U('Index/applyMarking')}";
	var urlImages="/sc2.0/Public/images/";
    </script>
    <!--<style>
    *{border: 1px solid rgb(250,0,255);}
    </style>-->
</head>
<body>


    <!-- 头部导航开始 -->
 <include file="Index/title" />
    <!-- 主体信息开始 -->

    <div id='contents' class="container">
    <div class="hall-toptext"> 阅读智慧，有如乐谱一般，令人心醉 </div>
    <div class="hall-toptext" style="font-size:14px">Reading wisdom is like intoxicating music</div> 
    <p>&nbsp;</p>

        <div class="panel panel-default discuss-cont">

            <div class="panel-body">

                <div class="card-head">
                    <div class="card-head-left"><a href="{:U('Index/hispage',array('hispage'=>$list['uid']))}"><img src="{$list['uimg']}" width="45"   class="img-circle"/></a></div>
                    <div class="card-head-center"><a href="{:U('Index/hispage',array('hispage'=>$list['uid']))}">{$list['uname']}</a> <span style="color:#999">发表</span><span style="color:#92D076;">文章</span><small>@{$list['atime']|date='Y-m-d H:i:s',###}</small></div>
                  <!--  <div class="card-head-right btn btn-success"> 订阅 {$list['aorder']}</div>-->
                  <div class="card-head-right"><small><span class="fa fa-eye fa-lg" style="color:#99A9C8" title="浏览量"> {$list['num']} </span>&nbsp;&nbsp;&nbsp;&nbsp;</small></div>
                    <div class="clearfix"></div>
                </div>
                <div class="card-body" id="fuck22">
                    <div class="title discuss">{$list['atitle']}</div>
                    <div class="articleMarking" value="{$list['uid']}" valueAid="{$list['aid']}">
                   {$list['acontent']}
                    </div>
                    <span class="textColor" value=""></span>
                </div>
                <div class="article-colorctr btn-toolbar">
                    <div class="btn-group" style="font-size:16px; color:#99A9C8;">
                        请选中你认为不完善的词语或句子，然后选一种高亮显示的颜色
                    </div>
                    <div class="btn-group" id="colorctr">
                        <button class="btn changecolor" id="color-1" ><i class="fa fa-circle color-1"></i></button>
                        <!--<button class="btn changecolor" id="color-2" ><i class="fa fa-circle color-2"></i></button>-->
                        <button class="btn changecolor" id="color-3"><i class="fa fa-circle color-3"></i></button>
                        <button class="btn changecolor" id="color-4" ><i class="fa fa-circle color-4"></i></button>
                        <!--<button class="btn changecolor" id="color-5" ><i class="fa fa-circle color-5"></i></button>-->
                        <button class="btn changecolor" id="color-6" ><i class="fa fa-circle color-6"></i></button>
                        <button class="btn changecolor" id="color-7" ><i class="fa fa-circle color-7"></i></button>
                        <button class="btn changecolor" id="color-8" ><i class="fa fa-circle color-8"></i></button>
                    </div>
                </div>
            </div>

        </div>
        <!--批阅的模态框-->
     <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h3 class="modal-title" id="myModalLabel">补充内容</h3>
                    </div>
                    <div class="modal-body">
                        <textarea rows="12" cols="73" class="border"></textarea>
                    </div>
                    <div class="modal-footer">
                    	<button id="invite" type="button" data-loading-text="正在提交..." class="btn btn-primary">完成</button>
                        
                    </div>
                   </div>
              </div>
          </div>       
        
        <!--模态框结束-->
        <div class="discuss-user" style="margin-bottom:150px;">
            <div class="discuss-user-left"> </div>  <!--//批阅者-->
            <div class="discuss-user-center" id="user" style="width:740px">
                <!--<img src="__PUBLIC__/user/image/3-lg.png" width="30" id="user-3" />-->
                
            </div>
            <div class="discuss-user-right">
            <if condition="$is eq 1">
            <button type="button" class="btn btn-primary piyue"style="min-width:96px;">请补充</button>
            <else/>
                <button type="button" class="btn btn-primary shenqin"style="min-width:96px;">我想补充一些内容</button>
                </if>
            </div>           
        </div>
        
      <!-- JiaThis Button BEGIN -->
<script type="text/javascript" >
var jiathis_config={
	siteNum:5,
	sm:"tsina,qzone,tqq,weixin,cqq",
	summary:"",
	boldNum:5,
	showClose:true,
	shortUrl:true,
	hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code_mini/jiathis_r.js?btn=r3.gif&move=0" charset="utf-8"></script>
<!-- JiaThis Button END -->


        
        

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">进入智慧公社</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
                                <div class="col-sm-10">
                                    <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox"> Remember me
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="login">进入</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div> <!-- 主体信息结束 -->
    <footer>
        
    </footer>
					<script type="text/javascript">
						$(document).ready(function () {
							$('.markingCont').each( function(){
								var valueId = $(this).attr("valueId");
								var This = $(this);
								var cont;
								$.ajax({
									url:urlLookMarking,
									type:'POST',
									//async:false,
									dataType:"JSON",
									data:
									{
										'valueId':valueId
									},
									success: function(data)
									{
										This.popover(
										{title: data['user_name']+'  '+data['operate_time'], content: data['operate_content'],placement:'bottom',trigger: 'click'})
									},
						
								});
							});						
						});
                    </script>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    <script type="text/javascript">
	var tr;
	var span;
  function setColor(color,uid) {
		if (document.all) {
			 tr = document.selection.createRange();
			tr.execCommand("ForeColor", false, color);
		} else {
			 tr = window.getSelection().getRangeAt(0);
		    span = document.createElement("span");
			span.style.cssText = "color:" + color;
			span.className="markingCont cursor";
			$(span).attr({'value':uid});
			//tr.surroundContents(span);
			
			
		}
		
	}
	$('#invite').click(function(){
		var content=$('.border').val();
		var textColor=$('.textColor').attr('value');
		var aid=$('.articleMarking').attr('valueAid');
		$.ajax({
			    url:url,
				type:'POST',
				data:{"aId":aid,"content":content},        
			success:function(data){
				$(span).attr({'valueId':data});
				tr.surroundContents(span);
				var articleCont=$('.articleMarking').html();
				$.ajax({
					url:urlArticle,
					type:'POST',
					data:{"aId":aid,"articleCont":articleCont},
					success:function(data){
						if(data){
						$('#myModal1').modal('hide');}
						}
					});
				
				}
			
			});
		
		});
       </script>
    <script type="text/javascript">
        jQuery(function ($) {
            $(document).ready(function () {
                var header = new Headroom(document.querySelector(".navbar"), {
                    tolerance: 0,
                    offset: 0,
                    classes: {
                        initial: "animated",
                        pinned: "slideDown",
                        unpinned: "slideUp"
                    }
                });
		 $('.changecolor').click(function () {
			color = $(this).children('i').css("color");
			uid=$('.articleMarking').attr('value');
			id = $(this).attr("id");
			$('.textColor').attr({'value':color});
			setColor(color,uid);
			$('#user-1').css({ "border-color": color, "border-width": "2px" });
			$('#colorctr').children('button').each(function () {
				if (id != $(this).attr("id")) {
					$(this).fadeOut();
				}
			$('#myModal1').modal()
			});
		});
                header.init();
                $('button[data-loading-text]').click(function () {
                    var btn = $(this).button('loading');
                    setTimeout(function () {
                        btn.button('reset');
                    }, 2000);
                });
                $('.card').mouseover(function () {
                    $(this).find('.close').toggleClass("hidden");
                });
                $('.card').mouseout(function () {
                    $(this).find('.close').toggleClass("hidden");
                });
                $('[data-dismiss="fuck"]').click(function () {
                    $(this).closest('.card').fadeOut(1000);
                });
                //var messcont = $("#myTabContent").find(".mess-close").size();
                //$(".mess-nord").text(messcont);



               

                /*$('#login').click(function () {
                    $('#myModal').modal('toggle');
                    if ($('#piyue').text() != "批阅") {
                        $('#piyue').text("批阅");
                    }
                });*/
                $('.piyue').click(function () {
                    if ($('.piyue').text() == "请补充") {
                        if($('.article-colorctr').css("display")=="none"){
                        $('#user').append('<img src="__PUBLIC__/user/image/1-lg.png" width="30" id="user-1"/>');
                        $('.article-colorctr').fadeIn();
                        }
                    }else{
                        $('#myModal').modal('toggle');
                    }
                });
		function judge(text){
				var sl=$('.sl').attr('value');
				if(!sl){
							$('.modal-title').html(text);
							$('#myModal').modal('toggle');
							return false;
					}	
				else{
					return true;
					}	
				  
		       }
              $('.shenqin').click(function(){
				  var text='智慧重地，请出示通行证';
                  if(!judge(text))return false;
				  var auid=$('.articleMarking').attr("value");
				  var aid=$('.articleMarking').attr("valueAid");
				  $.ajax({
					  url:urlApply,
					  type:'POST',
					  data:{'auid':auid,'aid':aid},
					  success: function(data){
						  if(data=='true'){
						  $('.shenqin').text('√ 已申请').removeClass('shenqin');
						  }
						  }
					  
					  });
				  });  
            });
			
			
			
				$('.example').popover();
			
			
        });
		
		
    </script>
    
    <include file="Index/copyright" />    
    
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1000482871'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s4.cnzz.com/z_stat.php%3Fid%3D1000482871%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>


</body>
</html>